package com.ExecutorsThreads;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

//控制线程池的最大线程数
public class MyExecutorsThreads3 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        executorService.submit(() -> System.out.println(Thread.currentThread().getName() + "现在正常执行的"));
        executorService.submit(() -> System.out.println(Thread.currentThread().getName() + "现在正常执行的"));
//        关闭线程
        executorService.shutdown();
    }
}
